<?php
if (isset($Special_Specifications) and ($Special_Specifications)) {
    echo "<div class='single_border_window'>";
    foreach ($Special_Specifications as $Special_ATTRGRP) {
        ?>

        <div class="mws-form-row">
            <div class="mws-form-item small">
                <?php
                echo $this->Form->input('', array(
                    'type' => 'text',
                    'class' => 'mws-textinput',
                    'label' => false,
                    'id' => 'gb1',
                    'disabled' => 'disabled',
                    'value' => $Special_ATTRGRP['AttrGroup']['name'],
                ));
                ?>
                <?php
                echo $this->Form->input('Product.Groupattribute', array(
                    'type' => 'hidden',
                    'id' => 'gb2',
                    'class' => 'mws-textinput',
                    'label' => false,
                    'value' => $Special_ATTRGRP['AttrGroup']['id'],
                ));
                ?>
            </div>
        </div>
        <div class="clear" style=" clear:both;"></div>
        <?php
        if (isset($Special_ATTRGRP['AttrGroup']['Attributes']) and ($Special_ATTRGRP['AttrGroup']['Attributes'])) {
            ?>
            <div class="editable_addattr">
                <div class="mws-form-row" style="width:100%;">
                    <div class="mws-form-item small"> <span id="editable_ajaxAttr">
            <?php
            foreach ($Special_ATTRGRP['AttrGroup']['Attributes'] as $arrbute) {
                ?>
                                <div id="ATTR<?php echo $arrbute['Attribute']['id']; ?>">
                                    <div class="mws-form-row">
                                        <label>Selected Attribute:</label>
                                        <div class="mws-form-item small">
                                            <input type="text" readonly="readonly" 
                                                   value="<?php echo $arrbute['Attribute']['name']; ?>" class="mws-textinput">
                                            <input type="hidden" name="data[Product][Attr][<?php echo $arrbute['Attribute']['id']; ?>][id]"
                                                   value="<?php //echo $specification['Specification']['id'];  ?>" style="width:100px;">
                                            <input type="hidden" name="data[Product][Attr][<?php echo $arrbute['Attribute']['id']; ?>][attribute]"
                                                   value="<?php echo $arrbute['Attribute']['id']; ?>" style="width:100px;">
                                            <input type="hidden" name="data[Product][Attr][<?php echo $arrbute['Attribute']['id']; ?>][key]" value="<?php echo $arrbute['Attribute']['name']; ?>" class="sd">
                                        </div>
                                    </div>
                                    <div class="mws-form-row">
                                        <label>Attribute Value:</label>
                                        <div class="mws-form-item small">
                                            <div class="input text">
                <?php
                if (isset($arrbute['Attribute']['required']) and ($arrbute['Attribute']['required'] == 1)) {

                    $requred = "required='required'";
                    $show_required = "Required";
                } else {
                    $requred = "";
                    $show_required = "optional";
                }
                ?>
                                                <input type="text" 
                                                       name="data[Product][Attr][<?php echo $arrbute['Attribute']['id']; ?>][attr_value]"
                                                <?php echo $requred; ?> value="<?php //echo $specification['Specification']['value']; ?>" class="mws-textinput"
                                                       id="ProductAttrValue" style="width:306px;">(<?php echo $show_required; ?>)
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div style="clear:both;" class="clear"></div>
                <?php
            }
            ?>
                        </span> </div>
                </div>
            </div>
                            <?php
                        }
                        ?>
        <div class='clear' style='clear:both;'></div>
        <?php
    }
    echo "</div>";
}
/* else{ */
?>
